// ignore_for_file: unnecessary_null_comparison

import 'package:dmz/base/pageWidget/base_stateful_widget.dart';
import 'package:dmz/base/widget/load_state_widget.dart';
import 'package:dmz/business/home/controller/map_controller.dart';
import 'package:dmz/business/home/widgets/map_widgets.dart';
import 'package:dmz/tools/map/map_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class MapPage extends BaseStatefulWidget<MapPgaeController> {
  const MapPage({super.key});

  @override
  String titleString() => '电子围栏'.tr;

  @override
  Widget buildContent(BuildContext context) {
    return controller.initLatLng == null
        ? createEmptyWidget(controller)
        : Column(children: [
            MapWidgets.fenceTopeWidget(
                controller.actionOpen ? controller.initAddresss : '',
                controller.selectData,
                controller.actionOpen,
                controller.selectDataAcrion,
                controller.didOpen),
            Expanded(
                child: EMIGDMapWidget(
                    latLng: controller.initLatLng,
                    onMapCreated: (controllered) =>
                        controller.mapController = controllered,
                    initMarkerMap: controller.markerMap,
                    selfLocationBack: controller.changeCarme))
          ]);
  }
}
